<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log((3.1415).toFixed(3)); //3.142

      // 6.35=>6.349999
      console.log((6.35).toFixed(1)); //6.3
      console.log((6.35).toFixed(20));
    </script>
  </body>
</html>
